
<!DOCTYPE HTML>
<html lang="en">
<head>
    <link rel="stylesheet" href="__PUBLIC__/phone/css/styles.css" />
    <link rel="stylesheet" href="__PUBLIC__/phone/css/swiper-3.4.2.min.css" />
    <script src="__PUBLIC__/phone/js/swiper-3.4.2.min.js"></script>
    <meta charset='UTF-8' />
    <meta name='generator' content='ecos.b2c' />
    <title>商品详情</title>
    <meta name='keywords' content='' />
    <meta name='description' content='' />
    <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'/>

    <link href="__PUBLIC__/phone/css/zhuce_style.css" rel="stylesheet" media="screen, projection" />
    <script src="__PUBLIC__/phone/js/shop.min.js"></script>
    <style type="text/css">
        .herder{
          position: fixed;
          top:0;
          z-index: 99999;
        }
        .item3-cartnum{
            line-height: 20px;
            width: 20px;
            height: 20px;
            color: white;
            position: absolute;
            bottom: 35px;
            background: red;
            border-radius: 50%;
            left: 46%;
        }
        body{
          height:100%;
          /*overflow:hidden;*/
          background-color: #F7F7F8;padding: 0;
        }
        #ht{
          opacity: 0.9;
          padding: 30px;
          background: darkgray;
          position: fixed;
          top: 50%;
          left: 20%;
          z-index: 999999999999;
          color: white;
          font-size: x-large;
        }
        .line-through{
          text-decoration:line-through;
        }
        .k-foot{
            height: 50px;width: 100%;
            background: gainsboro;
            position: fixed;
            bottom: 0px;
            z-index: 9999;
        }
        .k-foot ul li{
            float: left;
            list-style: none;
            width: 15%;
            line-height: 50px;
            text-align: center;
        }
        .k-foot ul li img{
            padding-top: 8px;
            height: 33px;
            margin-top: -4px;
        }
        #cart-count{
            line-height: 20px;
            /* text-align: center; */
            width: 20px;
            height: 20px;
            color: white;
            position: absolute;
            bottom: 30px;
            background: red;
            border-radius: 50%;
            /* padding: 1px 5px; */
            left: 38%;
        }
        .aa img{
            width:100%;
        }
    </style>
</head>
<body style="">
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "//hm.baidu.com/hm.js?cdc1b98600fd737ffd391a2e9ad3bd57";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
    <div class="full-screen">
        <header style="position: fixed;top: 0px;z-index: 9999;width: 100%;background: #00a1f2;">
            <span data-id="" id="kum-a" class="hide"></span>
            <div class="a-bar" id="tabs">
                <div style="width: 10%;line-height: 30px;">
                    <a href="javascript:history.go(-1);" class="kum-a" style="" id="" >
                    <span class="arr left" style="height: 10px;width: 10px;margin-left: 10px"></span>
                    </a>
                </div>
                <div class="a-name" id="tabs-def" data-value="goods" style="width: 30%;height: 30px;text-align: center;color:white;margin-left: -40px;">商品详情</div>
            </div>
        </header>
        <div id="goods" style="margin-top:40px;">
        <form action="/index.php/wap/cart-add-goods.html" method="post" id="buy_form" data-type="ajax" style="padding-bottom: 50px">
            <input type="hidden" name="btype" class="btype"><!-- value="is_fastbuy" 立即购买提交的时候要带上这个值 -->
            <input type="hidden" name="" value="{$info.good_id}" id="good_id"/>
            <input type="hidden" name="prepare_type" value="">
            <input type="hidden" name="goods[product_id]" value="840"/ >
            <input type="hidden" name="min" value="1" class="min-num" />
            <input type="hidden" name="max" value="14" class="max-num" />
            <input type="hidden" name="mini_cart" value="true"/>
            <!-- 商品图片 -->
            <div class="page pt-pic">
                <img src="__ROOT__{$info.picture}" id="product" style="width: 100%">
            </div>
            <!-- 商品标题 -->
            <h1 class="pt-name">{$info.good_name}</h1>
            <!-- 商品价格 -->
            <if condition="session('vip') eq 1">
                <div class="col2 pt-price" style="border-bottom: 1px;padding-left: 8px;">
                    <!-- 商品价格 -->
                    <div class="col price" style="padding: 0 0 0 0;">
                        <div style="height: 20px;float: left;">
                        <span><span style="font-size: 14px;font-weight: 100;color: black;">销售价：</span>
                            <b class="price" style="font-size: 14px;color: #999;text-decoration: line-through">￥{$info.price}</b>
                        </span>
                        </div>
                    </div>
                </div>
                <div class="col2 pt-price" style="border-bottom: 1px;padding-left: 8px;">
                    <!-- 商品价格 -->
                    <div class="col price" style="padding: 0 0 10px 0;">
                        <div style="height: 24px;float: left;">
                            <span><span style="font-size: 14px;font-weight: 100;color: black;">会员价：</span><b class="price  ">￥{$info.vip_price}</b></span>
                        </div>
                    </div>
                </div>
                <else/>
                <div class="col2 pt-price" style="border-bottom: 1px;padding-left: 8px;">
                    <!-- 商品价格 -->
                    <div class="col" style="padding: 10px 0;">
                        <div style="height: 26px;float: left;">
                        <span><span style="font-size: 14px;font-weight: 100;color: black;">销售价：</span>
                            <b class="price">￥{$info.price}</b>
                        </span>
                        </div>
                        <div style="height: 26px;float: right;margin-right: 10px;">
                        <span><span style="font-size: 14px;font-weight: 100;color: black;">销量：</span>
                            {$info.sale} 件
                        </span>
                        </div>
                    </div>
                </div>
            </if>


            <div class="pt-sku" style="padding:0;cursor: pointer;" id="this-box-show">
                <div class="sel-sku" id="" style="  border-bottom: 1px solid #bfbfbf;border-top: 1px solid #bfbfbf;padding: 5px;">
                    <div class="sku" style="width: 88%;margin: 0;">
                        规格：<span id="kum-sku"></span>{$info.grade}<span id="kum-num"></span>
                    </div>
                </div>
            </div>

            <div class="pt-sku aa" style="padding:8px 0 8px 10px;border-top:1px solid #bfbfbf;cursor: pointer;width: 100%">
                商品详情：{$info.desc|htmlspecialchars_decode}
            </div>
        </form>
    </div>

    <div style="" class="k-foot">
        <ul>
            <li>
                <a href="{:U('index')}" class="footer01"></a>
                <div style="margin-top: -35px;">首页</div>
            </li>
            <li>
                <a href="{:U('cate')}" class="footer04"></a>
                <div style="margin-top: -35px;">分类</div>
            </li>
            <li>
                <if condition="session('user_id') neq null">
                    <a href="{:U('cart')}" class="footer02"></a>
                    <span id="cart-count">{$cart_num}</span>
                    <div style="margin-top: -35px;">购物车 </div>
                    <else/>
                    <a href="{:U('login')}" class="footer02"></a>
                    <div style="margin-top: -35px;">购物车 </div>
                </if>
            </li>
            <li style="position: relative;">
                <a style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;" target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2675162351&site=qq&menu=yes">
                    <img border="0" src="__PUBLIC__/phone/img/kefu.png" alt="联系客服" title="联系客服"/>
                </a>
                <div style="margin-top: 15px;">客服</div>
            </li>
            <li style="width: 40%;background: #EF0000;color: white;line-height: 50px;">
                <if condition="session('user_id') neq null">
                    <a href="#" style="display: block;" class="Button1" id="J_buy_btn"><font color="white">加入购物车</font></a>
                    <else/>
                    <a href="#" style="display: block;" onclick="alert('请先登录！')"><font color="white">加入购物车</font></a>
                </if>

            </li>
        </ul>
    </div>
    <div id="ht" class="hide" >加入购物车成功<div>
        <script>
            $(".Button1").click(function() {
                var shopOffset = $("#cart-count").offset();
                var cloneDiv = $("#product").clone();
                var proOffset = $("#product").offset();
                cloneDiv.css({ "position": "fixed", "top": proOffset.top, "left": proOffset.left ,"z-index":"9999","width":"100%"});
                cloneDiv.removeAttr("id")
                $("#product").parent().prepend(cloneDiv);
                cloneDiv.animate({
                    left: shopOffset.left,
                    top: shopOffset.top,
                    width:"50px",
                    height:"50px"
                },"slow",function(){
                    //添加购物车
                    var goods_id = $('#good_id').val();
                    $.ajax({
                        url:"{:U('add_cart')}",
                        data:{"goods_id":goods_id},
                        type:"post",
                        success:function (e){
                            if(e == 1){
                                $("#cart-count").text(parseInt($("#cart-count").text())+1)
                                cloneDiv.css('display','none')
                            }else if(e == -1){
                                alert('已添加过该商品');
                            }else{
                                alert("数据异常");
                            }
                        }
                    })

                });
            });
        </script>
</body>
</html>